package com.kly.domain.enums;

import lombok.Getter;

/**
 * @author admin
 * @date 2025/3/11
 */
@Getter
public enum SpaceTypeEnum {
    PRIVATE("个人空间", 0),
    TEAMED("团队空间", 1),
    ;

    /**
     * 名称
     */
    private final String name;

    /**
     * 类型
     */
    private final Integer type;


    SpaceTypeEnum(String name, Integer type) {
        this.name = name;
        this.type = type;
    }


    /**
     * 获取枚举值
     */
    public static SpaceTypeEnum getEnumByLevel(Integer type) {
        if (type == null) {
            return null;
        }
        for (SpaceTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }
}
